Compiler warning "not found in protocol(s)" when using [[[UIApplication sharedApplication] delegate]

Posted by DK Crame on Stack Overflow See other posts from Stack Overflow or by DK Crame
Published on 2009-05-12T23:49:03Z Indexed on 2010/05/17 20:11 UTC
Read the original article Hit count: 544

I have myClass instantiated by my appDelegate, I have another class, newClass instantiated by myClass. From the newClass instance, I want to access a property in the myClass instance that created it. I have done this by:

[[[UIApplication sharedApplication].delegate myClass] property]

This works, I can actually get the property but I get this warning from Xcode:

warning: "-myClass" not found in protocols
warning: no "-myClass" method found  
(messages without a matching signature will be assumed to return "id" and accept "..." as arguments)

The newClass property has been correctly declared in the .h and .m files, it's properties have been set and it has been synthesized.

It compiles and runs and I can actually get the property's value.

Should I ignore the warning in Xcode?

Is there a better way to access the myClass instance's property?

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about objective-c-runtime